# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         less1.02
# Description:
# Author:       asus
# Date:         2019/3/6
#-------------------------------------------------------------------------------


#值传递，内部会改变，外部不会改变
a = 1
b = 2
def add(a,b):
    a = a + 1
    b = b + 1
    print('add函数内部:')
    print('内部',id(a))
    print('a=',a)
    print('b=',b)

add(a,b)

print('add函数外部')
print('外部',id(a))
print('a=',a)
print('b=',b)

#引用传递会内外部同时改变
l1 = [1,2]
print('外部',id(l1))
def add2(list):
    print('add2函数内部:')
    print('内部',id(list))
    list[0] = list[0] + 10
    list[1] = list[1] + 20
    print(list)

add2(l1)
print('add2函数外部')
print(l1)

def add3(a,b):
    # list[0] = list[0] + 100
    # list[1] = list[1] + 100
    a = a + 100
    print(a)

add3(*l1)

def jc(n):
    if n == 0 or n == 1:
        return 1
    else:
        return n * jc(n -1)

print(jc(100))